<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        window.onload=function(){
            document.getElementsByTagName("input")[4].onclick=function(){
                var a=Number(document.getElementsByTagName("input")[0].value);
                var b=Number(document.getElementsByTagName("input")[1].value);
                var c=Number(document.getElementsByTagName("input")[2].value);
                if((a+b>c)&&(a+c>b)&&(b+c>a)){
                    var s=(a+b+c)/2
                    var sqr=Math.sqrt(s*(s-a)*(s-b)*(s-c));
                    document.getElementsByTagName("input")[3].value=sqr;
                }else{
                     document.getElementsByTagName("input")[3].value="不是三角形";
                 }  
            }
            document.getElementsByTagName("input")[5].onclick=function(){
                document.getElementsByTagName("input")[0].value="";
                document.getElementsByTagName("input")[1].value="";
                document.getElementsByTagName("input")[2].value="";
                document.getElementsByTagName("input")[3].value="";
            }
        }
    </script>
</head>
<body>
    <h1>请输入三角形的边长</h1>
    <input type="text" name="" id="" placeholder="请输入第一条边">
    <input type="text" name="" id="" placeholder="请输入第二条边">
    <input type="text" name="" id="" placeholder="请输入第三条边">
    <input type="text" name="" id="" placeholder="三角形的结果或面积">
    <input type="button" value="确定">
    <input type="button" value="重置">
</body>
</html>